package cn.caplike.demo.repository.java;

/**
 * Description:
 *
 * @author LiKe
 * @version 1.0.0
 * @date 2021-10-13 16:33
 */
public class Random {

    public static void main(String[] args) {
        final java.util.Random random = new java.util.Random();
        final StringBuilder stringBuffer = new StringBuilder();
        for (int i = 0; i < 7; i++) {
            int number = random.nextInt(3);
            long result = 0;
            switch (number) {
                case 0:
                    result = Math.round(Math.random() * 25 + 65);
                    stringBuffer.append((char) result);
                    break;
                case 1:
                    result = Math.round(Math.random() * 25 + 97);
                    stringBuffer.append((char) result);
                    break;
                case 2:
                    stringBuffer.append(new java.util.Random().nextInt(10));
                    break;
            }
        }
        System.out.println(stringBuffer);
    }

}
